package com.zzy.face.service.impl;

import com.zzy.face.dao.TeacherDao;
import com.zzy.face.dto.TeacherInfo;
import com.zzy.face.dto.TeacherList;
import com.zzy.face.model.Teacher;
import com.zzy.face.service.TeacherService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author 朱泽玉
 * @Create 2022/1/30 17:13
 * @Description
 * @Modified By:
 */
@Service
public class TeacherServiceImpl implements TeacherService {
    final TeacherDao teacherDao;

    public TeacherServiceImpl(TeacherDao teacherDao) {
        this.teacherDao = teacherDao;
    }

    @Override
    public void save(Teacher teacher) {
        teacherDao.save(teacher);
    }

    @Override
    public void del(Long uid) {
        teacherDao.delete(teacherDao.getOne(uid));
    }

    @Override
    public List<TeacherInfo> findTeachersInfo() {
        return teacherDao.findTeachersInfo();
    }

    @Override
    public TeacherInfo findTeacherInfo(Long uid) {
        return teacherDao.findTeacherInfo(uid);
    }

    @Override
    public Teacher findTeacherById(Long uid) {
        return teacherDao.getOne(uid);
    }

    @Override
    public List<TeacherList>  findTeacherListByCollege(String college) {
        return teacherDao.findTeacherListInCollege(college);
    }
}
